<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body style="border: 0px; margin: 0px; padding: 0px;width: 100%;height: 100%">
<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
    <table style="width:100%;">
        <tr>
            <td>
				病情类别：
				<input id="illness_type" emptyText="请选择..." class="mini-treeselect" url="illness_type_list_view.do" multiSelect="false"  valueFromSelect="true"
			        textField="name" showClose="true" oncloseclick="clearT" valueField="id" parentField="pid" allowInput="false" showRadioButton="true" showFolderCheckBox="false" popupWidth="200px;"/>
            </td>
			<td style="white-space:nowrap;">
				<a class="mini-button" iconCls="icon-search" onclick="search()">查询</a>
			</td>
        </tr>
    </table>           
</div>
<div class="mini-fit" >
<div id="container1" style="min-width: 310px; height: 100%;width: 100%;"></div>
</div>

<script type="text/javascript">
mini.parse();
var data = [];
var options = {
	chart: {
	        type: 'pie'
    },
    title: {
        text: '病情统计性别分布图'
    },
    plotOptions: {
        column: {
            pointPadding: 0.2,
            borderWidth: 0
        }
    },
    series:[{	
    	type: 'pie',
        name: '性别人数'
    }],
    credits:{
    	text:"",
        href:"javascript:void(0);"
    }
};
var illness = mini.get("illness_type");
$(document).ready(function(){
	view();
});
function search(){
	view();
}
function view(){
	data = [];
	var chart = $('#container1').highcharts(options);
	$.post("illness_gender_view.do", {illness: illness.getValue()}, function(info){
        $.each(info,function(i,d){
       		data.push([i,d]);
        });
        chart = new Highcharts.Chart(options);
		chart.series[0].setData(data);
	}, "json");
}
function clearT(e){
	e.sender.setValue("");
}
</script>
</body>
</html>